package com.example.webbackend.service;

import com.example.webbackend.model.Message;
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
import java.util.List;

public interface MessageService {
    SseEmitter subscribe(String username);
    Message sendMessage(Message message);
    List<Message> getMessageHistory(Long groupId);
    List<Message> getOfflineMessages(String username);
    
    // 新增缓存相关方法
    void processAndPushMessage(Message message);
    void cacheMessage(Message message);
    List<Message> getCachedMessages(String username);
    void clearMessageCache(String username);
}